/*
 * Created by SharpDevelop.
 * Author: Joey
 * Date: 26/09/2007
 * Time: 02:09
 * 
 * Source is copyright Joey Sabey 2007
 */

using System;
using System.Drawing;
using System.Windows.Forms;

namespace MonoTheism
{
	/// <summary>
	/// Description of Script_Properties.
	/// </summary>
	public partial class Script_Properties : Form
	{
		private bool bAcceptChanges = false;
		public bool AcceptChanges
		{
			get{return bAcceptChanges;}
		}
		public string ScriptFile
		{
			get{return txtScriptFile.Text;}
		}
		
		public Script_Properties()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
		}
		public Script_Properties(string scriptfile)
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			this.txtScriptFile.Text = scriptfile;
		}
		
		void BtOkClick(object sender, EventArgs e)
		{
			this.bAcceptChanges = true;
			Close();
		}
		
		void BtCancelClick(object sender, EventArgs e)
		{
			Close();
		}
		
		void BtBrowseClick(object sender, EventArgs e)
		{
			OpenFileDialog ofdSelectFile = new OpenFileDialog();
			ofdSelectFile.Filter = "CAOS Files|*.cos|"
								 + "All Files|*.*";
			
			if(ofdSelectFile.ShowDialog() == DialogResult.OK)
			{
				txtScriptFile.Text = ofdSelectFile.FileName;
			}
			else
			{
				WarningDialogue warning = new WarningDialogue("File Dialogue Error");
			}
		}
	}
}
